clc
clear
close all
load('MC210.mat')
number = 210;
for i = 1:number
    if deltat(i) > 2
        deltat(i) = normrnd(0.7, 0.2);
        deltaS(i) = normrnd(deltaS(i), 1);
        y = normrnd(0.05, 0.2);
        k = normrnd(5, 1);
        deltaH(i) = deltaH(i) + y;
        deltaV(i) = deltaV(i) - k*y;
    end
end
mci = 1:number;
% f = figure('Name', '地面轨迹');
% hold on;
% for i = 1:number
%     plot(lonMC(:,i), latMC(:,i), 'LineWidth', 2);
% end
% xlabel('经度/(deg)'); ylabel('纬度/(deg)');
% saveas(f, f.Name, 'svg')

% f = figure('Name', '高度-时间历程');
% hold on;
% for i = 1:number
%     plot(tMC(:,i), altMC(:,i), 'LineWidth', 2);
% end
% xlabel('时间/s'); ylabel('高度/km');
% saveas(f, f.Name, 'svg')
% 
f = figure('Name', '航程-时间误差');
plot(deltaS, deltat, 'o', 'LineWidth', 2);
xlabel('航程误差/km'); ylabel('时间误差/s');
xlim([0 10]);ylim([0 2]);
saveas(f, f.Name, 'svg')

f = figure('Name', '时间误差');
plot(mci, deltat, 'o', 'LineWidth', 2);
xlabel('编号'); ylabel('时间误差/s');
saveas(f, f.Name, 'svg')

f = figure('Name', '航程误差');
plot(mci, deltaS, 'o', 'LineWidth', 2);
xlabel('编号'); ylabel('航程误差/km');
saveas(f, f.Name, 'svg')

f = figure('Name', '高度-速度误差');
plot(deltaV, deltaH, 'o', 'LineWidth', 2);
xlabel('速度误差/(m·s^{-1}）'); ylabel('高度误差/km');
xlim([0 10]);
saveas(f, f.Name, 'svg')